package com.joker.product.controller;

import com.joker.common.core.domain.Result;
import com.joker.product.domain.SkuDetailVO;
import com.joker.product.service.IPmsDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

/**
 * @author lemon
 * @date 2024/12/24 16:31
 **/
@RestController
@RequestMapping("/detail")
public class PmsSkuDetailController {

    @Autowired
    private IPmsDetailService pmsDetailService;

    @GetMapping("/{skuId}")
    public Result<SkuDetailVO> getDetailBySkuId(@PathVariable Long skuId) throws ExecutionException, InterruptedException {
        SkuDetailVO skuDetailVO = pmsDetailService.getDetailBySkuId(skuId);
        return Result.success(skuDetailVO);
    }

}
